from django.contrib import admin
from .models import FileInfo


# Register your models here.
class fileManager(admin.ModelAdmin):
    list_display = ['pName', 'pSize', 'pUpdate', 'pImage']
    readonly_fields = ['pSize', 'pName']
    # def get_file_size(self, obj):
    #     return obj.pImage.size if obj.pImage else 0  # 返回文件大小
    #
    # get_file_size.short_description = '文件大小 (字节)'  # 列标题


admin.site.register(FileInfo, fileManager)
